#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int num1,num0;
	num1 = num0 = 0;
	for(int i = 0;i<n;i++)
	{
		char c;
		cin>>c;
		if(c=='1')num1++;
		else num0++;
	}
	cout<<n-2*min(num1,num0)<<endl;
}
